<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2022/3/13
  Time: 16:31
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>订单查询</title>
    <script>

        (function($){
            $(window).load(function(){

                $("a[rel='load-content']").click(function(e){
                    e.preventDefault();
                    var url=$(this).attr("href");
                    $.get(url,function(data){
                        $(".content .mCSB_container").append(data); //load new content inside .mCSB_container
                        //scroll-to appended content
                        $(".content").mCustomScrollbar("scrollTo","h2:last");
                    });
                });

                $(".content").delegate("a[href='top']","click",function(e){
                    e.preventDefault();
                    $(".content").mCustomScrollbar("scrollTo",$(this).attr("href"));
                });

            });
        })(jQuery);
    </script>
</head>
<body>
<jsp:include page="header.jsp"/>
<section class="rt_wrap content mCustomScrollbar">
    <div class="rt_content">
        <div class="page_title">
            <h2 class="fl">订单列表示例</h2>
            <a class="fr top_rt_btn add_icon">添加商品</a>
        </div>
        <section class="mtb">
            <select class="select">
                <option>订单状态</option>
                <option>待付款</option>
                <option>待发货</option>
                <option>待评价</option>
            </select>
            <input type="text" class="textbox textbox_225" placeholder="输入订单编号或收件人姓名/电话..."/>
            <input type="button" value="查询" class="group_btn"/>
        </section>
        <table class="table">
            <tr>
                <th>订单编号</th>
                <th>收件人</th>
                <th>联系电话</th>
                <th>收件人地址</th>
                <th>订单金额</th>
                <th>快递单号</th>
                <th>操作</th>
            </tr>

            <c:forEach var="order" items="${order.list}">
                <tr>
                    <td class="center">${order.orderId}</td>
                    <td>${order.address.name}</td>
                    <td>${order.address.num}</td>
                    <td>
                        <address>${order.address.city}${order.address.county}${order.address.detailed}</address>
                    </td>
                    <td class="center"><strong class="rmb_icon">${order.total}.00</strong></td>
                    <td class="center">${order.fastMail}</td>
                    <td class="center">
                        <a href="${pageContext.request.contextPath}/orderList/orderDetail?id=${order.orderId}" title="查看订单" class="link_icon" target="_blank">&#118;</a>
                        <a href="#" title="删除" class="link_icon">&#100;</a>
                    </td>
                </tr>
            </c:forEach>
        </table>
        <aside class="paging">
            <a href="${requestScope['javax.servlet.forward.request_uri']}?name=<%=request.getAttribute("key")%>&pn=${order.pageNum-1}" id="btn02">上一页</a>
            <c:forEach begin="1" end="${order.pages}" var="i">
                <a href="${requestScope['javax.servlet.forward.request_uri']}?name=<%=request.getAttribute("key")%>&pn=${i}">${i}</a>
            </c:forEach>
            <a href="${requestScope['javax.servlet.forward.request_uri']}?name=<%=request.getAttribute("key")%>&pn=${order.pageNum+1}" id="btn01">下一页</a>
        </aside>
    </div>
</section>
</body>
</html>
